<?php

use Illuminate\Database\Seeder;
use \App\Entities\Participant;

class ParticipantsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $models = Participant::query()
            ->where('uniqueid', '')
            ->get();
        foreach ($models as $model) {
            Participant::query()
                ->where('id', $model->id)
                ->update([
                    'uniqueid' => $model->openid,
                ]);
        }
    }
}
